package com.reports;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import org.apache.log4j.Logger;

import com.util.Util;
import com.vo.TUserVO;

public class TUserDAO {
	Logger logger = Logger.getLogger(TUserDAO.class);
	Connection con = null;
	PreparedStatement pstmt = null;	
	public int memberInsert(TUserVO tvo)
	{
		logger.info("====================================");
		logger.info("====TUserDAO memberInsert success====");
		logger.info("====================================");
		int result = 0;
		StringBuilder query = new StringBuilder();
		query.append("INSERT INTO t_user VALUES(?,?,?)");	
	   try{
		   con = Util.getConnectionPool();
		   pstmt = con.prepareStatement(query.toString());
		   pstmt.setString(1, tvo.getName());
		   pstmt.setString(2, tvo.getEmail());
		   pstmt.setString(3, tvo.getComments());
		   result = pstmt.executeUpdate();
	   }catch(SQLException se){
		    logger.info("query"+query.toString());
		}catch(Exception e){
		    e.printStackTrace();
		}
		return result;
	}
}
